package com.h3c.nem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.h3c.nem.entity.TbOfferArchieve;
import org.apache.ibatis.annotations.Insert;

/**
 * 专业技术成果记录数据库访问层
 *
 * @author chenyifan
 * @since 2022-06-06 16:35:43
 */
public interface TbOfferArchieveMapper extends BaseMapper<TbOfferArchieve> {

    @Insert("INSERT INTO tb_offer_archieve \n" +
            "(archieve_id, worker_id, offer_id, archieve_name, archieve_content, \n" +
            "org_name, org_level, update_time) \n" +
            "SELECT \n" +
            "nextval('hrssseq'), a.HC_NO, b.OfferID, b.FName, b.FContent, \n" +
            "b.FEmployer, b.FEmployerLevel, NOW() \n" +
            "FROM Offer_Send_Detail a, Offer_Archievements b \n" +
            "WHERE a.id= b.OfferID" )
    void initArchieveRecordFromHrss();
}

